import 'package:flutter_test/flutter_test.dart';
import 'package:frp_http_proxy/frp_http_proxy.dart';
import 'package:frp_http_proxy/frp_http_proxy_platform_interface.dart';
import 'package:frp_http_proxy/frp_http_proxy_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockFrpHttpProxyPlatform
    with MockPlatformInterfaceMixin
    implements FrpHttpProxyPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final FrpHttpProxyPlatform initialPlatform = FrpHttpProxyPlatform.instance;

  test('$MethodChannelFrpHttpProxy is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelFrpHttpProxy>());
  });

  test('getPlatformVersion', () async {
    FrpHttpProxy frpHttpProxyPlugin = FrpHttpProxy();
    MockFrpHttpProxyPlatform fakePlatform = MockFrpHttpProxyPlatform();
    FrpHttpProxyPlatform.instance = fakePlatform;

    expect(await frpHttpProxyPlugin.getPlatformVersion(), '42');
  });
}
